/**
 * 
 * @author Huang Junjie
 * 
 */
package TimeSqueeze.logic;

import TimeSqueeze.storage.TempStorage;

public class MarkDone implements CommandInterface{
	
	private String taskDescription;
	
	public MarkDone(String paras){
		taskDescription = paras;
	}
	
	@Override
	public void execute(){
		for (int i = 0; i < TempStorage.deadlineTasks.size(); i++) {
			if (TempStorage.deadlineTasks.get(i).getDescription().equals(taskDescription)) {
				TempStorage.deadlineTasks.get(i).setDone(true);
			}
		}

		for (int i = 0; i < TempStorage.timedTasks.size(); i++) {
			if (TempStorage.timedTasks.get(i).getDescription().equals(taskDescription)) {
				TempStorage.timedTasks.get(i).setDone(true);
			}
		}

		for (int i = 0; i < TempStorage.untimedTasks.size(); i++) {
			if (TempStorage.untimedTasks.get(i).getDescription().equals(taskDescription)) {
				TempStorage.untimedTasks.get(i).setDone(true);
			}
		}
	}
	
	@Override
	public void undo(){
	
	}

}
